import { id } from 'element-plus/es/locale';
import request from '/@/utils/request';

/**
 * 
 * 会员等级列表
**/
export function apilevelList(query:Object) {
    return request({
        url: '/api/v1/ucenter/config/vip',
        method: 'get',
        params:query
    })
}
/**
 * 
 * 删除会员等级http://123.160.10.252:8818/api/v1/ucenter/config/vip/{id}
**/
export function apideletelevelList(id:Object) {
    return request({
        url: '/api/v1/ucenter/config/vip/'+id,
        method: 'delete',
        data:{}
    })
}
/**
 * 
 * 添加会员等级http://123.160.10.252:8818/api/v1/ucenter/config/vip
**/
export function apiaddlevelList(data:object) {
    return request({
        url: '/api/v1/ucenter/config/vip',
        method: 'post',
        data:data
    })
}

/**
 * 
 * 修改查询会员等级列表
**/
export function apieditlevelList(data:Object,id:Number) {
    return request({
        url: '/api/v1/ucenter/config/vip/'+ id,
        method: 'put', 
        data:data
    })
}

/**
 * 
 * 上传会员等级图片http://127.0.0.1:8808/api/v1/system/upload/upImgs' \
**/
export function apiaddPictures(data:object) {
    return request({
        url: '/api/v1/system/upload/upImg',
        method: 'post',
        data:data
    })
}
export function apiMemberList(query:Object) {
    return request({
        url: '/api/v1/ucenter/user/list',
        method: 'get',
        params:query
    })
}

export function getRoleParams() {
    return request({
        url: '/api/v1/system/role/getParams',
        method: 'get'
    })
}
export function getRoleList() {
    return request({
        url: '/api/v1/system/role/getParams',
        method: 'get'
    })
}
export function apiMemberListaddRole(data:object) {
    return request({
        url: '/api/v1/ucenter/user',
        method: 'post',
        data:data
    })
}

export function getRole(id:number) {
    return request({
        url: '/api/v1/system/role/get',
        method: 'get',
        params:{id}
    })
}


export function editRole(data:object) {
    return request({
        url: '/api/v1/system/role/edit',
        method: 'put',
        data:data
    })
}


export function deleteRole(id:number) {
    return request({
        url: '/api/v1/system/role/delete',
        method: 'delete',
        data:{ids:[id]}
    })
}

export function dataScope(data:any) {
    return request({
        url: '/api/v1/system/role/dataScope',
        method: 'put',
        data:data
    })
}


// 根据角色ID查询部门树结构
export function roleDeptTreeSelect(roleId:number) {
    return request({
        url: '/api/v1/system/role/deptTreeSelect',
        method: 'get',
        params:{roleId}
    })
}


